package com.td.erhome;


import com.td.erhome.utils.ConstUtils;
import com.td.erhome.utils.SharePreHelper;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;

import org.litepal.LitePalApplication;

import cn.sharesdk.framework.ShareSDK;

/**
 * Created by Administrator on 2016/10/11 0011.
 */

public class App extends LitePalApplication {
    public static App INS;
    public IWXAPI mIWXAPI;

    // 单例模式获取唯一的MyApplication实例
    public static App getInstance() {
        if (null == INS) {
            INS = new App();
        }
        return INS;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        INS = this;
        ShareSDK.initSDK(this); //ShareSDK
        SharePreHelper.getIns().initialize(this, null);

        mIWXAPI = WXAPIFactory.createWXAPI(this, ConstUtils.APP_ID,true);
        mIWXAPI.registerApp(ConstUtils.APP_ID);
    }
}
